import request from '@/content/utils/request'

const getChapterLessonByBookId = (data) => {
  return request({
    url: '/lesson/getChapterLessonByBookId',
    method: 'post',
    data,
  })
}

const downloadUrl = (url, data) => {
  return request({
    url: url,
    method: 'post',
    data,
  })
}

// 获取系统中所有的科目信息
const getAllSubjectIds = () => {
  return request({
    url: '/lesson/getAllSubjectIds',
    method: 'get',
    params: {},
  })
}

// 用户创建课程留言反馈
const createFeedBackByLesson = (data) => {
    return request({
      url: '/feedback/createFeedBackByLesson',
      method: 'post',
      data,
    })
}

// 分页查询某个用户所有课程反馈记录
const queryFeedBackBLessons = (data) => {
    return request({
      url: '/feedback/queryFeedBackBLessons',
      method: 'post',
      data,
    })
}

// 分页查询某个用户所有课程反馈记录
const getFeedBackInfoById = (data) => {
    return request({
      url: '/feedback/getFeedBackInfoById',
      method: 'post',
      data,
    })
}

const getQiniuUploadToken = (data) => {
    return request({
        url: '/resource/getQiniuUploadToken',
        method: 'post',
        data,
    })
}
export default {
  getChapterLessonByBookId,
  downloadUrl,
  getAllSubjectIds,
  createFeedBackByLesson,
  queryFeedBackBLessons,
  getFeedBackInfoById,
  getQiniuUploadToken,
}
